package com.huatao.wx.handler;

public enum WxChatMsgTypeEnum {

    SUBSCRIBE("event.subscribe", "用户关注事件"),
    TEXT_MSG("text", "接受用户文本消息");

    private String msgType;
    private String desc;

    WxChatMsgTypeEnum(String msgType, String desc) {
        this.msgType = msgType;
        this.desc = desc;
    }

    public static WxChatMsgTypeEnum getByMsgType(String msgType) {
        for (WxChatMsgTypeEnum type : WxChatMsgTypeEnum.values()) {
            if (type.msgType.equals(msgType)) {
                return type;
            }
        }
        return null;
    }
}
